<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 
 <script type="text/javascript" src="js/jquery.min.js"></script>
<body>

<!-- <input id="tt" > 测试

<script type="text/javascript">	
$(function(){ 		
	window.addEventListener("storage", function(event){  			
		console.log(event.key + "=" + event.newValue);  
		haha(event.newValue);
		});   	
	});
	
	function haha(v){
		document.getElementById("tt").value=v;
	}
</script> -->




<script type="text/javascript">
	$(function(){ 
		function getCookie(key) {  
			return JSON.parse("{\"" + document.cookie.replace(/;\s+/gim,"\",\"").replace(/=/gim, "\":\"") + "\"}")[key];  
		}   
		setInterval(function(){  
			console.log("name=" + getCookie("name"));  
		}, 1000);  
	});
	</script>
</body>
</html>